﻿using CTP.CRM.Repository.Enum;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CTP.CRM.Repository.User.Entitys
{
    /// <summary>
    /// 用户表
    /// </summary>
    [SugarTable("t_user")]
    public class UserEntity : IFullAuditedBasicEntitys
    {
        /// <summary>
        /// id
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(ColumnName = "Account")]
        public string Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(ColumnName = "PassWord")]
        public string PassWord { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [SugarColumn(ColumnName = "Name")]
        public string Name { get; set; }

        /// <summary>
        /// 英文名
        /// </summary>
        [SugarColumn(ColumnName = "EnName")]
        public string EnName { get; set; }

        ///<summary>
        /// 公司id
        ///</summary>
        [SugarColumn(ColumnName = "CompanyId")]
        public int? CompanyId { get; set; }

        ///<summary>
        /// 部门id
        ///</summary>
        [SugarColumn(ColumnName = "DeptId")]
        public int? DeptId { get; set; }

        ///<summary>
        /// 用户直接组织节点Id
        ///</summary>
        [SugarColumn(ColumnName = "OrgId")]
        public int? OrgId { get; set; }

        /// <summary>
        /// 是否业务员
        /// </summary>
        [SugarColumn(ColumnName = "IsBusiness")]
        public bool? IsBusiness { get; set; }

        /// <summary>
        /// 默认语言
        /// </summary>
        [SugarColumn(ColumnName = "DefaultLang")]
        public byte DefaultLang { get; set; }

        /// <summary>
        /// 是否启用（状态）
        /// </summary>
        [SugarColumn(ColumnName = "IsEnable")]
        public bool IsEnable { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [SugarColumn(ColumnName = "TelPhone")]
        public string TelPhone { get; set; }

        /// <summary>
        /// 员工Id
        /// </summary>
        [SugarColumn(ColumnName = "EmployeeId")]
        public int? EmployeeId { get; set; }

        /// <summary>
        /// 用户来源（1.员工入职 2.手动添加 3.其他）
        /// </summary>
        [SugarColumn(ColumnName = "UserOrigin")]
        public UserOriginEnum? UserOrigin { get; set; }

        /// <summary>
        /// 用户公司类型
        /// </summary>
        [SugarColumn(ColumnName = "UserCoType")]
        public UserCoType? UserCoType { get; set; }

        /// <summary>
        /// 用户类型
        /// </summary>
        [SugarColumn(ColumnName = "UserType")]
        public UserType? UserType { get; set; }


        /// <summary>
        /// OA salt
        /// </summary>
        [JsonIgnore]
        [SugarColumn(ColumnName = "Salt")]
        public string Salt { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [SugarColumn(ColumnName = "Email")]
        public string Email { get; set; }

        /// <summary>
        /// 区号
        /// </summary>
        [SugarColumn(ColumnName = "AreaCode")]
        public string AreaCode { get; set; }
    }
}
